<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head><title>导航树</title>
	<%@include file="../../../web.inc"%>
<%
BOResultSet boresult = dataSet.getBoResultSet("menu_bo");
TSAdminMenuNavi naviInfo = (TSAdminMenuNavi)boresult.getDataMapValue("navi_info");
String treeHtml = boresult.getDataMapValueToStr("tree_html");//
List menuList = (List)boresult.getDataMapValue("menu_list");
%>
</head>
<body>
<div style="margin: 10px 0;"></div>
<ul id="easyui_tree" class="easyui-tree">
	<li><span><%=naviInfo.getNaviName() %></span>
		<ul>
	<%=treeHtml %>
		</ul>
	</li>
</ul>
<script type="text/javascript">
var menuUrl = new Array();
<%
VSAdminMenuNavi tvo ;
int iIndex = 0;
for(int i = 0 ; i < menuList.size() ; i++){
	tvo = (VSAdminMenuNavi)menuList.get(i);
	if(tvo.getMenuType() == EnTreeNodeType.Link.getCode()){//如果是链接
%>
	menuUrl[<%=iIndex%>] = new Array();
	menuUrl[<%=iIndex%>][0] = "<%=tvo.getMenuId()%>";
	menuUrl[<%=iIndex%>][1] = "<%=tvo.getMenuUrl()%>";
<%	
		iIndex++;
	}
}
%>
		$('#easyui_tree').tree({
			onClick : function(node) {
				for(var i = 0 ; i < menuUrl.length ; i++){
					if(menuUrl[i][0] == node.id){
						funAddTab(node.text,node.text,menuUrl[i][1]);
						break;
					}else{
					}
				}//end for
			}
		});
	</script>
</body>
</html>